<html lang="en"><head></head><body><form id="mainForm" method="post" action="https://embed.plnkr.co?show=preview" target="eplnkr"><input type="hidden" name="entries[app/app.component.ts][content]" value="import { Component } from '@angular/core';
import { HTTP_PROVIDERS } from '@angular/http';

import { CharactersComponent } from './characters.component';

@Component({
  moduleId: module.id,
  selector: 'story-app',
  template: `
  <div>
    <h1>Storyline Tracker</h1>
    <h3>Component Demo</h3>
    <story-characters [storyId]=&quot;7&quot; (changed)=changed($event)></story-characters>
  </div>
  `
})
export class AppComponent {
  changed(changedCharacter: any) {
    if (changedCharacter) {
      console.log(`Event Emitter said you selected ${changedCharacter.name}`);
    }
  }
}


/*
Copyright 2016 JohnPapa.net, LLC. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://bit.ly/l1cense
*/"><input type="hidden" name="entries[app/app.component.ts][encoding]" value="utf8"><input type="hidden" name="entries[app/app.module.ts][content]" value="import { NgModule } from '@angular/core';
import { BrowserModule  } from '@angular/platform-browser';
import { HttpModule } from '@angular/http';

import { AppComponent } from './app.component';
import { CharacterComponent } from './character.component';
import { CharactersComponent } from './characters.component';

@NgModule({
  imports: [
    BrowserModule,
    HttpModule
  ],
  declarations: [
    AppComponent,
    CharacterComponent,
    CharactersComponent
  ],
  bootstrap: [AppComponent],
})
export class AppModule { }


/*
Copyright 2016 JohnPapa.net, LLC. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://bit.ly/l1cense
*/"><input type="hidden" name="entries[app/app.module.ts][encoding]" value="utf8"><input type="hidden" name="entries[app/character.component.ts][content]" value="import { Component, Input } from '@angular/core';

import { Character } from './character.service';

@Component({
  moduleId: module.id,
  selector: 'story-character',
  template: '<h3 *ngIf=&quot;character&quot;>You selected {{character.name}}</h3>',
})
export class CharacterComponent {
  @Input() character: Character;
}


/*
Copyright 2016 JohnPapa.net, LLC. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://bit.ly/l1cense
*/"><input type="hidden" name="entries[app/character.component.ts][encoding]" value="utf8"><input type="hidden" name="entries[app/character.service.ts][content]" value="import { Injectable } from '@angular/core';
import { Http, Response } from '@angular/http';
import 'rxjs/add/operator/map';

export class Character {
  id: number;
  name: string;
}

@Injectable()
export class CharacterService {
  constructor(private http: Http) { }

  getCharacters(storyId: number) {
    return this.http
      .get('api/characters.json')
      .map((response: Response) => response.json().data);
  }
}


/*
Copyright 2016 JohnPapa.net, LLC. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://bit.ly/l1cense
*/"><input type="hidden" name="entries[app/character.service.ts][encoding]" value="utf8"><input type="hidden" name="entries[app/characters.component.ts][content]" value="import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { Character, CharacterService } from './character.service';

@Component({
  moduleId: module.id,
  selector: 'story-characters',
  templateUrl: 'characters.component.html',
  styleUrls: ['characters.component.css'],
  providers: [CharacterService]
})
export class CharactersComponent implements OnInit {
  @Output() changed = new EventEmitter<Character>();
  @Input() storyId: number;

  characters: Character[];
  selectedCharacter: Character;

  constructor(private characterService: CharacterService) { }

  ngOnInit() {
    this.characterService.getCharacters(this.storyId)
      .subscribe(characters => this.characters = characters);
  }

  select(selectedCharacter: Character) {
    this.selectedCharacter = selectedCharacter;
    this.changed.emit(selectedCharacter);
  }
}



/*
Copyright 2016 JohnPapa.net, LLC. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://bit.ly/l1cense
*/"><input type="hidden" name="entries[app/characters.component.ts][encoding]" value="utf8"><input type="hidden" name="entries[main.ts][content]" value="import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';

platformBrowserDynamic().bootstrapModule(AppModule)
  .then(success => console.log(`Bootstrap success`))
  .catch(err => console.error(err));


/*
Copyright 2016 JohnPapa.net, LLC. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://bit.ly/l1cense
*/"><input type="hidden" name="entries[main.ts][encoding]" value="utf8"><input type="hidden" name="entries[app/characters.component.css][content]" value=".characters {
  list-style-type: none;
}

*.characters li {
  padding: 4px;
  cursor: pointer;
}

*.characters li .selected {
  background-color: #ccc;
  width: 250px;
}


/*
Copyright 2016 JohnPapa.net, LLC. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://bit.ly/l1cense
*/"><input type="hidden" name="entries[app/characters.component.css][encoding]" value="utf8"><input type="hidden" name="entries[styles.css][content]" value="/* Master Styles */
h1 {
  color: #369;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 250%;
}
h2, h3 {
  color: #444;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: lighter;
}
body {
  margin: 2em;
}
body, input[text], button {
  color: #888;
  font-family: Cambria, Georgia;
}
a {
  cursor: pointer;
  cursor: hand;
}
button {
  font-family: Arial;
  background-color: #eee;
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  cursor: hand;
}
button:hover {
  background-color: #cfd8dc;
}
button:disabled {
  background-color: #eee;
  color: #aaa;
  cursor: auto;
}

/* Navigation link styles */
nav a {
  padding: 5px 10px;
  text-decoration: none;
  margin-top: 10px;
  display: inline-block;
  background-color: #eee;
  border-radius: 4px;
}
nav a:visited, a:link {
  color: #607D8B;
}
nav a:hover {
  color: #039be5;
  background-color: #CFD8DC;
}
nav a.active {
  color: #039be5;
}

/* items class */
.items {
  margin: 0 0 2em 0;
  list-style-type: none;
  padding: 0;
  width: 24em;
}
.items li {
  cursor: pointer;
  position: relative;
  left: 0;
  background-color: #EEE;
  margin: .5em;
  padding: .3em 0;
  height: 1.6em;
  border-radius: 4px;
}
.items li:hover {
  color: #607D8B;
  background-color: #DDD;
  left: .1em;
}
.items li.selected:hover {
  background-color: #BBD8DC;
  color: white;
}
.items .text {
  position: relative;
  top: -3px;
}
.items {
  margin: 0 0 2em 0;
  list-style-type: none;
  padding: 0;
  width: 24em;
}
.items li {
  cursor: pointer;
  position: relative;
  left: 0;
  background-color: #EEE;
  margin: .5em;
  padding: .3em 0;
  height: 1.6em;
  border-radius: 4px;
}
.items li:hover {
  color: #607D8B;
  background-color: #DDD;
  left: .1em;
}
.items li.selected {
  background-color: #CFD8DC;
  color: white;
}

.items li.selected:hover {
  background-color: #BBD8DC;
}
.items .text {
  position: relative;
  top: -3px;
}
.items .badge {
  display: inline-block;
  font-size: small;
  color: white;
  padding: 0.8em 0.7em 0 0.7em;
  background-color: #607D8B;
  line-height: 1em;
  position: relative;
  left: -1px;
  top: -4px;
  height: 1.8em;
  margin-right: .8em;
  border-radius: 4px 0 0 4px;
}
/* everywhere else */
* {
  font-family: Arial, Helvetica, sans-serif;
}


/*
Copyright 2016 JohnPapa.net, LLC. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://bit.ly/l1cense
*/"><input type="hidden" name="entries[styles.css][encoding]" value="utf8"><input type="hidden" name="entries[app/characters.component.html][content]" value="<article>
  <ul class=&quot;characters&quot;>
    <li *ngFor=&quot;let character of characters&quot;>
       <div (click)=&quot;select(character)&quot;
        [class.selected]=&quot;character === selectedCharacter&quot;
        >{{character.id}}. {{character.name}}</div>
    </li>
  </ul>
  <story-character [character]=&quot;selectedCharacter&quot;></story-character>
</article>


<!-- 
Copyright 2016 JohnPapa.net, LLC. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://bit.ly/l1cense
-->"><input type="hidden" name="entries[app/characters.component.html][encoding]" value="utf8"><input type="hidden" name="entries[index.html][content]" value="<!DOCTYPE html>
<html>

<head>
  <script>document.write('<base href=&quot;' + document.location + '&quot; />');</script>

  <meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;>
</head>

<body>
  <story-app>Loading Storyline Tracker ...</story-app>

  <script src=&quot;https://npmcdn.com/core-js/client/shim.min.js&quot;></script>
  <script src=&quot;https://npmcdn.com/zone.js@0.6.26?main=browser&quot;></script>
  <script src=&quot;https://npmcdn.com/reflect-metadata@0.1.8&quot;></script>
  <script src=&quot;https://npmcdn.com/systemjs@0.19.40/dist/system.src.js&quot;></script>

  <script>
    System.import('systemjs.config.js')
      .then(function () { System.import('main') })
      .catch(console.error.bind(console));
  </script>
</body>

</html>


<!-- 
Copyright 2016 JohnPapa.net, LLC. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://bit.ly/l1cense
-->"><input type="hidden" name="entries[index.html][encoding]" value="utf8"><input type="hidden" name="entries[api/characters.json][content]" value="{
  &quot;data&quot;: [
    {
      &quot;id&quot;: 11,
      &quot;name&quot;: &quot;Chewbacca&quot;,
      &quot;side&quot;: &quot;light&quot;
    },
    {
      &quot;id&quot;: 12,
      &quot;name&quot;: &quot;Rey&quot;,
      &quot;side&quot;: &quot;light&quot;
    },
    {
      &quot;id&quot;: 13,
      &quot;name&quot;: &quot;Finn (FN2187)&quot;,
      &quot;side&quot;: &quot;light&quot;
    },
    {
      &quot;id&quot;: 14,
      &quot;name&quot;: &quot;Han Solo&quot;,
      &quot;side&quot;: &quot;light&quot;
    },
    {
      &quot;id&quot;: 15,
      &quot;name&quot;: &quot;Leia Organa&quot;,
      &quot;side&quot;: &quot;light&quot;
    },
    {
      &quot;id&quot;: 16,
      &quot;name&quot;: &quot;Luke Skywalker&quot;,
      &quot;side&quot;: &quot;light&quot;
    },
    {
      &quot;id&quot;: 17,
      &quot;name&quot;: &quot;Poe Dameron&quot;,
      &quot;side&quot;: &quot;light&quot;
    },
    {
      &quot;id&quot;: 18,
      &quot;name&quot;: &quot;Kylo Ren&quot;,
      &quot;side&quot;: &quot;dark&quot;
    },
    {
      &quot;id&quot;: 19,
      &quot;name&quot;: &quot;Supreme Commander Snoke&quot;,
      &quot;side&quot;: &quot;dark&quot;
    },
    {
      &quot;id&quot;: 20,
      &quot;name&quot;: &quot;R2-D2&quot;,
      &quot;side&quot;: &quot;light&quot;
    },
    {
      &quot;id&quot;: 21,
      &quot;name&quot;: &quot;BB8&quot;,
      &quot;side&quot;: &quot;light&quot;
    },
    {
      &quot;id&quot;: 22,
      &quot;name&quot;: &quot;C-3PO&quot;,
      &quot;side&quot;: &quot;light&quot;
    },
    {
      &quot;id&quot;: 23,
      &quot;name&quot;: &quot;Maz Kanata&quot;,
      &quot;side&quot;: &quot;light&quot;
    },
    {
      &quot;id&quot;: 24,
      &quot;name&quot;: &quot;Captain Phasma&quot;,
      &quot;side&quot;: &quot;dark&quot;
    },
    {
      &quot;id&quot;: 25,
      &quot;name&quot;: &quot;General Hux&quot;,
      &quot;side&quot;: &quot;dark&quot;
    },
    {
      &quot;id&quot;: 26,
      &quot;name&quot;: &quot;Lor San Tekka&quot;,
      &quot;side&quot;: &quot;light&quot;
    }
  ]
}"><input type="hidden" name="entries[api/characters.json][encoding]" value="utf8"><input type="hidden" name="entries[api/vehicles.json][content]" value="{
  &quot;data&quot;: [
    {
      &quot;id&quot;: 30,
      &quot;name&quot;: &quot;Millennium Falcon&quot;,
      &quot;type&quot;: &quot;space&quot;
    },
    {
      &quot;id&quot;: 31,
      &quot;name&quot;: &quot;Y-Wing Fighter&quot;,
      &quot;type&quot;: &quot;space&quot;
    },
    {
      &quot;id&quot;: 32,
      &quot;name&quot;: &quot;X-Wing Fighter&quot;,
      &quot;type&quot;: &quot;space&quot;
    },
    {
      &quot;id&quot;: 33,
      &quot;name&quot;: &quot;Imperial Star Destroyer&quot;,
      &quot;type&quot;: &quot;space&quot;
    },
    {
      &quot;id&quot;: 34,
      &quot;name&quot;: &quot;AT-AT Walker&quot;,
      &quot;type&quot;: &quot;land&quot;
    },
    {
      &quot;id&quot;: 35,
      &quot;name&quot;: &quot;TIE Fighter&quot;,
      &quot;type&quot;: &quot;space&quot;
    },
    {
      &quot;id&quot;: 36,
      &quot;name&quot;: &quot;B-Wing Fighter&quot;,
      &quot;type&quot;: &quot;space&quot;
    },
    {
      &quot;id&quot;: 37,
      &quot;name&quot;: &quot;ETA-2 Jedi Starfighter&quot;,
      &quot;type&quot;: &quot;space&quot;
    },
    {
      &quot;id&quot;: 38,
      &quot;name&quot;: &quot;TIE Interceptor&quot;,
      &quot;type&quot;: &quot;space&quot;
    },
    {
      &quot;id&quot;: 39,
      &quot;name&quot;: &quot;X-34 Landspeeder&quot;,
      &quot;type&quot;: &quot;land&quot;
    },
    {
      &quot;id&quot;: 40,
      &quot;name&quot;: &quot;Snow Speeder&quot;,
      &quot;type&quot;: &quot;land&quot;
    }
  ]
}"><input type="hidden" name="entries[api/vehicles.json][encoding]" value="utf8"><input type="hidden" name="tags[0]" value="angular2"><input type="hidden" name="tags[1]" value="example"><input type="hidden" name="tags[2]" value="first look"><input type="hidden" name="tags[3]" value="angular 2"><input type="hidden" name="title" value="Angular 2 Example - Component with Input and Output"><input type="hidden" name="source[type]" value="Component with Input and Output"><input type="hidden" name="source[url]" value="https://angular.io"><input type="hidden" name="entries[README.md][content]" value="### Angular 2 First Look Example 

Component with Input and Output"><input type="hidden" name="entries[README.md][encoding]" value="utf8"><input type="hidden" name="entries[systemjs.config.js][content]" value="/**
 * PLUNKER VERSION
 * (based on systemjs.config.js in angular.io)
 * System configuration for Angular 2 samples
 * Adjust as necessary for your application needs.
 */
(function (global) {
  System.config({
    // DEMO ONLY! REAL CODE SHOULD NOT TRANSPILE IN THE BROWSER
    transpiler: 'ts',
    typescriptOptions: {
      tsconfig: true
    },
    meta: {
      'typescript': {
        &quot;exports&quot;: &quot;ts&quot;
      }
    },
    paths: {
      // paths serve as alias
      'npm:': 'https://unpkg.com/'
    },
    // map tells the System loader where to look for things
    map: {
      // our app is within the app folder
      app: 'app',
      'main':                       'main.js', // PAPA

      // angular bundles
      '@angular/core': 'npm:@angular/core/bundles/core.umd.js',
      '@angular/common': 'npm:@angular/common/bundles/common.umd.js',
      '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
      '@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
      '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
      '@angular/http': 'npm:@angular/http/bundles/http.umd.js',
      '@angular/router': 'npm:@angular/router/bundles/router.umd.js',
      '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
      '@angular/upgrade': 'npm:@angular/upgrade/bundles/upgrade.umd.js',

      // other libraries
      'rxjs':                       'npm:rxjs',
      'angular-in-memory-web-api':  'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js',
      'ts':                         'npm:plugin-typescript@4.0.10/lib/plugin.js',
      'typescript':                 'npm:typescript@2.0.3/lib/typescript.js',

    },
    // packages tells the System loader how to load when no filename and/or no extension
    packages: {
      'app/core': { main: 'index' }, // PAPA
      'app/models': { main: 'index' }, // PAPA
      'api': { defaultExtension: 'js' }, //PAPA
      app: {
        main: './main.ts',
        defaultExtension: 'ts'
      },
      rxjs: {
        defaultExtension: 'js'
      }
    }
  });
})(this);



/*
Copyright 2016 JohnPapa.net, LLC. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://bit.ly/l1cense
*/"><input type="hidden" name="entries[systemjs.config.js][encoding]" value="utf8"><input type="hidden" name="entries[tsconfig.json][content]" value="{
  &quot;compilerOptions&quot;: {
    &quot;target&quot;: &quot;es5&quot;,
    &quot;module&quot;: &quot;commonjs&quot;,
    &quot;moduleResolution&quot;: &quot;node&quot;,
    &quot;sourceMap&quot;: true,
    &quot;emitDecoratorMetadata&quot;: true,
    &quot;experimentalDecorators&quot;: true,
    &quot;removeComments&quot;: false,
    &quot;noImplicitAny&quot;: false,
    &quot;suppressImplicitAnyIndexErrors&quot;: true
  }
}
"><input type="hidden" name="entries[tsconfig.json][encoding]" value="utf8"></form><script>document.getElementById("mainForm").submit();</script></body></html>